/**
 * 获取header的消息提示
 */
'use strict';
const db = uniCloud.database()
const dbCmd = db.command;
exports.main = async (event, context) => {
	let {relevanceUserID} = event;
  let msgTipsRes = await db.collection('projects').where({
	 relevanceUserID,
	 vaildDate:dbCmd.gt(new Date().getTime())
  }).get()
  
  if(msgTipsRes.affectedDocs !== 0 || msgTipsRes.data.length !== 0){
	  return{
		  status:0,
		  data:msgTipsRes.data
	  }
  }else{
	  return{
		  status:1,
		  msg:"没有数据"
	  }
  }
  return {
	  status:-1,
	  msg:"稍后重试"
  }
};
